import request from '@/plugin/axios'

// 获取分页列表
export function getresponsibilitypage(params) {
    return request({
        url: '/upms/responsibility/page',
        method: 'get',
        params: request.adornParams(params)
    })
}
// 获取列表
export function getresponsibilitylist(params) {
    return request({
        url: '/upms/responsibility/list',
        method: 'get',
        params: request.adornParams(params)
    })
}


// 获取某个角色已分配的职责列表
export function getresponsibilityselectedlist(pkRole) {
    return request({
        url: '/upms/responsibility/role/' + pkRole,
        method: 'get',
        params: request.adornParams({})
    })
}
// 获取某个角色已分配的职责列表[ids]
export function getrespselectedrole(pkRole) {
    return request({
        url: '/upms/responsibility/role/selected/' + pkRole,
        method: 'get',
        params: request.adornParams({})
    })
}
// 获取组织下的职责列表
export function getResponsibilityByOrgs(params) {
    return request({
        url: '/upms/responsibility/orgs/' + params,
        method: 'get',
        params: request.adornParams({})
    })
}
// 获取组织下的业务职责列表
export function getBusRespByOrgs(params) {
    return request({
        url: '/upms/responsibility/orgs/' + params + "/bus",
        method: 'get',
        params: request.adornParams({})
    })
}
// 获取组织下的系统职责列表
export function getSysRespByOrgs(params) {
    return request({
        url: '/upms/responsibility/orgs/' + params + "/sys",
        method: 'get',
        params: request.adornParams({})
    })
}
// 查询某个职责和角色关系
export function getRoleByPkResp(params) {
    return request({
        url: '/upms/responsibility/getRoleByPkResp/' + params,
        method: 'get',
        params: request.adornParams({})
    })
}

// 获取信息
export function getresponsibilityinfo(id) {
    return request({
        url: '/upms/responsibility/info/' + id,
        method: 'get',
        params: request.adornParams({})
    })
}

// 添加职责
export function addresponsibility(data) {
    return request({
        url: '/upms/responsibility/save',
        method: 'post',
        data
    })
}

// 添加角色职责
export function addroleresp(data) {
    return request({
        url: '/upms/roleresp/save',
        method: 'post',
        data
    })
}

// 修改
export function updateresponsibility(data) {
    return request({
        url: '/upms/responsibility/update',
        method: 'put',
        data
    })
}

// 批量删除
export function delBatchresponsibility(params) {
    return request({
        url: '/upms/responsibility/delete',
        method: 'post',
        data: request.adornData(params, false)
    })
}

// 删除
export function delresponsibility(id) {
    return request({
        url: '/upms/responsibility/delete/' + id,
        method: 'delete',
    })
}
// 角色职责批量删除
export function delBatchroleresp(params) {
    return request({
        url: '/upms/roleresp/delete',
        method: 'post',
        data: request.adornData(params, false)
    })
}

// 角色职责删除
export function delroleresp(id) {
    return request({
        url: '/upms/roleresp/delete/' + id,
        method: 'delete',
    })
}